import java.util.Scanner;

public class Text2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();

        for (int i = 0; i < str.length(); i++) {
            for (int j = 0; j < str.length(); j++) {
                if (i != j && str.charAt(i)==str.charAt(j)){
                    break;
                } else if (j==str.length()-1){
                    System.out.println(str.charAt(i));
                    return;
                }
            }
        }

        System.out.println(-1);
    }
}
